# coding=utf-8
import arcpy
path = r'D:\WorkData\20250712四川河流\0813处理'
arcpy.env.workspace = path
arcpy.env.overwriteOutput = True
spatial_ref = arcpy.SpatialReference(4326)
riv = r'D:\WorkData\20250712四川河流\0813处理\rivs.shp'.decode('utf-8')
lp = r'D:\WorkData\20250712四川河流\0813处理\p.shp'.decode('utf-8')

cs1 = arcpy.da.UpdateCursor(lp,['SHAPE@','name'])
cs2 = arcpy.da.SearchCursor(riv,['SHAPE@','name','rivId','level'])

for row1 in cs1:
    for row2 in cs2:
        if(row1[0].within(row2[0])):
            print row1[1], '流入',row2[1]
    cs2.reset()